package com.fz.interceptor;

import java.io.*;

/**
 * Created by webrx on 2017/6/29.
 */
public class Test {
    public static void main(String[] args) throws IOException {
      /*  FileReader rr = new FileReader("c:/aa.txt");
        FileWriter ff = new FileWriter("c:/cc.txt");
        BufferedWriter bf = new BufferedWriter(ff);
        BufferedReader br = new BufferedReader(rr);
        char[] c= new char[1024];
       int nn= 0;
        //ff.write("hello:你好");
        while ((nn=rr.read(c))!=-1){

            String s =new String(c,0,nn);
            ff.write(c,0,nn);
            System.out.println(s);
           // nn=rr.read(c);
        }

        ff.flush();*/

        FileInputStream fin = new FileInputStream("c:/b.jpg") ;
        FileOutputStream fot= new FileOutputStream("c:/kk.jpg");
        BufferedInputStream bfin = new BufferedInputStream(fin);
        BufferedOutputStream bfot = new BufferedOutputStream(fot);
             int bb =0;
             byte[] by = new byte[1024];
            while((bb=bfin.read(by))!=-1){
                System.out.println(new String(by,0,bb));
                bfot.write(by,0,bb);
            }
            fot.flush();
    }
}
